<!doctype html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	   <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../css/style.css" />
		<link rel="stylesheet" href="../css/iconfont.css" />
		<script src="../js/mui.min.js"></script>
		<script src="../js/jquery-1.8.0.min.js"></script>
		<script src="../js/head_public.js"></script>
		<script src="../js/common.js"></script>
		<style>
			.gouwu-footer{background: #fff;}
			.gouwu-footer span{color: #777777;}
			.mui-active{color: #ff7e00!important;}
		</style>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav ding-bar">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">配件商城</h1>
		</header>
		<div class="mui-content" style="padding-bottom:0px">
		    <!--下拉刷新容器-->
		    <div id="pullrefresh" class="newslist w620 mui-scroll-wrapper" style="position: static;">
				<!--数据列表-->
			    <div class="mui-scroll conferDiv" style="position: static;">
			    	<ul class="store-list" id="store-list">
			    		
			    	</ul>
		        </div>
		    </div>
		</div>
		<!--<footer></footer>
		<script>
			$("footer").load("footer1.html")
		</script>-->
		<script type="text/javascript">
		var page=1;
		
		mui("footer").on("tap","a",function(){
			location.href=$(this).attr("data-href");
//			mui.openWindow({url:$(this).attr("data-href")})
		})
			
		mui(".store-list").on("tap","a",function(){
			location.href=$(this).attr("data-href");
		})
		mui(".store-list").on("tap",".gm-phone-icon",function(){
//			mui.openWindow({url:$(this).attr("data-href")})
            location.href=$(this).attr("data-href");
		})
	    var $height = $(window).height();
		var $height1 = $("header").height();
		$(".mui-scroll-wrapper").height( $height - $height1 );
		
		mui.init({
			pullRefresh: {
				container: '#pullrefresh',
				down: {
					style:'circle',
					callback: pulldownRefresh
				},
				up: {
					contentrefresh: '正在加载...',
					callback: pullupRefresh
				}
			}
		});
		/**
		 * 下拉刷新具体业务实现
		 */
		function pulldownRefresh() {
			setTimeout(function() {
				mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
				getContents();
			}, 1500);
		}
		/**
		 * 上拉加载具体业务实现
		 */
		function pullupRefresh() {
			setTimeout(function() {
				mui('#pullrefresh').pullRefresh().endPullupToRefresh(); //参数为true代表没有更多数据了。
				getContents();
			}, 1500);
		}
		function getContents(){
		     //		    读取列表
            data={};
            var searchinfo=getQueryString("searchinfo");
            if(searchinfo!=null&&searchinfo!=""){
            	searchinfo=decodeURI(decodeURI(searchinfo));
            }
            data.page=page;
            data.searchinfo=searchinfo;
			$.post(net+"/public/index.php?s=api/shop",data,function(data){
               if(data.code==200){
	               	if(data.result!=null&&data.result!=""&&data.result.length!=0){
	               		var str="";
	               		var src="";
	               		$.each(data.result, function(i,value) {
	               			var src=net+"public/uploads/home/store/"+this.store_id+"/"+this.store_avatar;
	               	   	    str+='<li><a data-href="info.html?id='+this.store_id+'"><img  src="'+src+'"/>'
	               	   	        +'<div class="store-con"><h1 class="only-line">'+this.store_name+'</h1><p class="only-twoline">'+this.store_mainbusiness+'</p>'
			    			    +'<button>已认证</button></div></a><img src="../images/phone.png"  class="gm-phone-icon"data-href="tel:\\'+this.store_phone+'"/></li>'
			    	
	               		});  
	               	   $("#store-list").append(str);
	               	   page++;
	               	}else{
	               		mui.toast("没有更多数据")
	               	}
               }
			   },'json'
			);
		}
		getContents();


		</script>
	</body>

</html>